An integer number is a whole number ranging from -2,147,483,648 to 2,147,483,647. Integer values may not include commas. Therefore, the number 5,380 should be entered as 5380. Name-index numbers (described in this section) work just like integer numbers.
Examples of integers
-2234798
0
32
A real number is any number ranging from 1.7 X 10 -308 to 1.7 X 10 +308, including decimals. Real values may not include commas. As such, the number 5,380.5 should be entered as 5380.5.
Examples of real numbers
-2.875638
844.2
65.0
When a simulation begins, locations, resources, and entities are all assigned numbers according to their position in their respective edit tables. The number assigned to the element is called its name-index number. For example, the third entity in the Entity edit table will have the number three for its name index number. The name of an element may be used in an expression to reference its name-index number.
For example, if EntityA were the third entity in the Entity edit table, the statement, “Attr1 = EntityA,” would assign the number three to Attr1, because attributes take numbers. Additionally, you may also test for an index number by referencing the element name with a statement like, “If Var5 = Location3 Then.” In fact, when using a name-index number to identify a location, resource, or entity (as in the previous examples), it is usually best to use the name of the element, because inserting or deleting an element from the edit table, may change the name-index number assigned to other elements.
If you need to refer to a location, resource, or entity by name but only know its name-index number, use the name functions: Loc(), Res(), and Ent(). These functions allow name-index numbers and variables or attributes containing name-index numbers to be converted back to their actual names for use in statements or expressions requiring the element name.
Consider the statement, “Attr1 = PASSENGER.” Although this statement only stores the name index number of the element in the attribute, the name-index number can then be used in conjunction with Loc(), Ent(), and Res() to get the actual name of the location. For example, if PASSENGER is the fifth entity in the Entity edit table, the statement Join 1 Ent(Attr1) works the same as Join 1 PASSENGER. Additionally, a name-index number can be used with the name functions to output a name to the screen or a file.
When an expression expects one type of value but receives another,
Converting from name-index numbers to the name of an element requires the Ent(), Loc(), and Res() functions as
© 2016 ProModel Corporation • 556 East Technology Avenue • Orem, UT 84097 • Support: 888-776-6633 • www.promodel.com |